#include "ThreadPool.h"
#include <time.h>
#include <iostream>
#include <string>
using namespace std;


void TestBroadCast()
{
    pthread_cond_t waitCond;
    pthread_mutex_t waitCondMutex;
    pthread_cond_init(&waitCond, NULL);
    pthread_mutex_init(&waitCondMutex, NULL);

    /*printf("before broadcast\n");
    pthread_cond_broadcast(&waitCond);
    printf("broadcast\n");*/

    printf("before wait cond\n");
    pthread_mutex_lock(&waitCondMutex);
    pthread_cond_wait(&waitCond, &waitCondMutex);
    pthread_mutex_unlock(&waitCondMutex);
    printf("after wait cond\n");
}

int main()
{
    //CThreadPool threadPool(5);
    //threadPool.InitialThreadPool();
    //string inputStr;
    //int taskNum = 0;
    //while(cin>>inputStr)
    //{
    //    for (int i=0;i<inputStr.size();++i)
    //    {
    //        Task *pTask = new Task(taskNum++);
    //        threadPool.PushTask(pTask);
    //    }
    //}

    ////threadPool.PrintThreadStatus();
    //threadPool.DestroyThreadPool();
    //system("pause");
    //return 0;
    TestBroadCast();
}